function S = get_changed_value(C, Rc)
%GET_CHANGED_VALUE
% Calculates values of S in MME papers.
%    0 (0/1) -> No change
%    N (0/1) -> N-1 (Rc >= 0) / N+1 (Rc < 0)
%
% Usage :
%  O = nonround_dct(img);
%  C = round(O);
%  Rc = C - O;
%  S = get_changed_value(C, Rc);
%
% Input:
%  C  -> c''        (rounded coeffients)
% Output:  
%  S  -> c''        (embeded coeffients, with every value CHANGED)
%

    %% calcuate S (e.g. embedding in every bit)
    S = C;
    [P,Q] = size(S);
    for i = 1:P
        for j = 1:Q
            if Rc(i,j) < 0
                S(i,j) = C(i,j) + 1;
            else % Rc(i,j) >= 0
                S(i,j) = C(i,j) - 1;
            end
        end
    end
end
